home *** CD-ROM | disk | FTP | other *** search
/ JCSM Shareware Collection 1996 September / JCSM Shareware Collection (JCS Distribution) (September 1996).ISO / tutorial / trac.zip / FIGIV-1.OBJ < prev    next >
Text File  |  1990-01-25  |  4KB  |  54 lines

  1. 0009          0 0009          0 Origin
  2. 0010     401000 STRT     RD   X Read X (Also sets next 4 locations to zero)
  3. 0011     001000          LD   X Load accumulator with X
  4. 0012     250048          BZSTOP If X is zero jump to halt instruction
  5. 0013     240017          BN*+4  If X is negative, skip next 3 instructions     
  6. 0014     001501          LD ONE Load +1                                        
  7. 0015     031502          ST   S Store at S (sign)                              
  8. 0016     260022          BU*+6  Branch unconditionally around next 5           
  9. 0017     001503          LDNEG1 Load -1                                        
  10. 0018     031502          ST   S Store at S                                     
  11. 0019     001500          LDZERO Load zero                                      
  12. 0020     021000          SU   X Subtract X (This makes a negative X positive)  
  13. 0021     031000          ST   X Store back at X                                
  14. 0022     001501          LD ONE Load 1                                         
  15. 0023     030002          ST   I I=1 using index register 2                     
  16. 0024     001000          LD   X Load X                                         
  17. 0025     360008          SR0008 Shift it right 8                               
  18. 0026     031001          ST   Y Store at Y                                     
  19. 0027     001001 LOOP     LD   Y Load Y (Note this is the start of a loop)      
  20. 0028     151504          MU ATE Multiply by 8                                  
  21. 0029     031001          ST   Y Store at Y                                     
  22. 0030     001000          LD   X Load X                                         
  23. 0031    2370000         2SL0000 Shift left by I (Contents of register 2)       
  24. 0032     360008          SR0008 Shift right 8 (This isolates an octal digit)   
  25. 0033     011001          AD   Y Add previous Y                                 
  26. 0034     031001          ST   Y Store back at Y                                
  27. 0035     000002          LD   I Load I                                         
  28. 0036     011501          AD ONE Add 1                                          
  29. 0037     030002          ST   I Store at I                                     
  30. 0038     021505          SUNINE Subtract 9 to see if done                      
  31. 0039     240027          BNLOOP If negative repeat loop                        
  32. 0040     001000          LD   X Load X                                         
  33. 0041     151502          MU   S Multiply by sign                               
  34. 0042     031000          ST   X Store at X                                     
  35. 0043     001001          LD   Y Load Y                                         
  36. 0044     151502          MU   S Multiply by sign                               
  37. 0045     031001          ST   Y Store at Y                                     
  38. 0046     411000          PC   X Print X, Y                                     
  39. 0047     260010          BUSTRT Branch back to start                           
  40. 0048     500000 STOP     HT0000 Halt
  41. 0001          0 0001          0 Re-origin to define I
  42. 0002          0    I          0
  43. 1499          0 1499          0 Re-origin for constants
  44. 1500          0 ZERO          0 Zero
  45. 1501          1  ONE          1 One
  46. 1502          0    S          0
  47. 1503         -1 NEG1         -1 Negative one
  48. 1504          8  ATE          8 Eight
  49. 1505          9 NINE          9 Nine
  50. 0999          0 0999          0 Re-origin for read area
  51. 1000          0    X          0
  52. 1001          0    Y          0
  53. 9999     000010          ENSTRT End of code and starting location
  54.